package com.luyuan.crm.user.service;

import java.util.List;

import org.hibernate.criterion.Order;

import com.luyuan.crm.user.Party;
import com.ruijie.components.security.model.AppUser;
import com.ruijie.foundation.annotation.DomainService;
import com.ruijie.foundation.query.Page;
import com.ruijie.foundation.query.criteria.CriteriaTemplate;

@DomainService
public interface PartyService {

    /**	
     * <p>Description:查询用户              </p>
     * <p>Create Time: 2010-8-4   </p>
     * @author Administrator
     * @return
     */
    Party getByAppUser(AppUser appUser);

    Party getById(String id);

    Party getByUserName(String userName);

    List<Party> findByRoleName(String[] roleName);

    /**	
     * <p>Description: 增加用户           </p>
     * <p>Create Time: 2010-8-4   </p>
     * @author Administrator
     * @param userModel
     */
    void addParty(Party party);

    /** 
     * <p>Description:   删除用户           </p>
     * <p>Create Time: 2010-8-4   </p>
     * @author Administrator
     * @param user
     */
    void removeParty(Party party);

    /**
     * <p>Description:     锁定帐号          </p>
     * <p>Create Time: 2012-7-23   </p>
     * @author Administrator
     * @param party
     */
    void disableParty(Party party);

    /**
     * <p>Description:     解锁帐号          </p>
     * <p>Create Time: 2012-7-23   </p>
     * @author Administrator
     * @param party
     */
    void enableParty(Party party);

    /**
     * <p>Description:     修改帐号信息          </p>
     * <p>Create Time: 2012-7-23   </p>
     * @author Administrator
     * @param loginName
     * @param password
     */
    void updatePassword(String loginName, String password);

    /**	
     * <p>Description:   更新用户          </p>
     * <p>Create Time: 2010-8-4   </p>
     * @author Administrator
     * @param user
     */
    void updateParty(Party party);

    Page pagedQuery(CriteriaTemplate criteria, int pageNo, int pageSize, List<Order> orders);
}
